//
//  HomePlanClassContentCell.m
//  test
//
//  Created by 朱圳 on 2018/2/2.
//  Copyright © 2018年 朱圳. All rights reserved.
//

#import "HomePlanClassContentCell.h"
#import "UILabel+HgLabel.h"

@interface HomePlanClassContentCell()
@property(nonatomic,strong)UILabel *classContentLabel;
@end


@implementation HomePlanClassContentCell


+ (instancetype)cellWithTableView:(UITableView *)tableView withReuseIdentifier:(NSString *)reuseIdentifier
{
    
    HomePlanClassContentCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
    cell.selectionStyle = 0;
    if (cell == nil) {
        cell = [[HomePlanClassContentCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    }
    
    cell.backgroundColor = [UIColor clearColor];
    return cell;
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        self.contentView.backgroundColor = [UIColor clearColor];
        [self createSubViews];
    }
    return self;
}
- (void)createSubViews{
    [self.contentView addSubview:self.classContentLabel];
    [self.classContentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(@3);
        make.left.equalTo(@5);
        make.right.equalTo(@(-5));
        make.bottom.equalTo(@0);
    }];
}


- (UILabel *)classContentLabel{
    if (!_classContentLabel) {
        _classContentLabel = [[UILabel alloc]init];
        _classContentLabel.font = [UIFont systemFontOfSize:14];
        _classContentLabel.numberOfLines = 0;
    }
    return _classContentLabel;
}
- (void)setContentModel:(ContentModel *)contentModel{
    _contentModel = contentModel;
    
    _classContentLabel.attributedText = [_classContentLabel getAttributedStringWithString:_contentModel.content lineSpace:2];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
